home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / commo51.zip / SAMPLES.MAC < prev    next >
Text File  |  1991-12-21  |  8KB  |  191 lines

  1.                   ┌───────────────────────────┐
  2.                   │ Additional Macro Examples │
  3.                   └───────────────────────────┘
  4.  
  5. This file contains a number of sample macros.  Feel free to copy any of them
  6. to COMMO.MAC and to alter them to your own needs.  Additions will be made to
  7. this file as time permits.  Thanks to the users for their contributions.
  8.  
  9. {COMMO} macros can be made to do many amazing things besides just logging into
  10. BBS's and doing mail runs (those are indeed popular functions, however).  Some
  11. of the simplest macros demonstrate this capability.
  12.  
  13.  
  14.  The first two macros are used for reading messages.  They use the grey plus
  15.  and minus keys in the lower right corner of the keyboard. The first one sends
  16.  a <cr>, then clears the screen.  Makes messages a lot easier to read since
  17.  each one starts displaying at the top of the screen.  The second macro just
  18.  sends a <cr>.  Nice for keyboards without the extra Enter key.
  19.  
  20.  Message reading macros
  21.  ───────────────────────────────────────────────────────────────────────────
  22.  {:gr+} {send |} {clear} {}
  23.  {:gr-} {send |} {}
  24.  
  25.  
  26. The next macro is a very important one.  It shows the basic method of asking
  27. for a filename and uploading the file.  Notice that it first sets the variable
  28. "file" to the upload directory (the variable "uldir").  Then when the INPUt
  29. function executes, the upload directory appears in the input line with a "\".
  30.  
  31.  Upload a file using Zmodem (via DSZ)
  32.  ───────────────────────────────────────────────────────────────────────────
  33.  {:af2} {setv file,%uldir\}
  34.         {input file,Enter a filename:}
  35.         {exec-AW DSZ port %_por sz -m %file} {}
  36.  
  37.  
  38.  Start my mail reader after a mail run
  39.  ───────────────────────────────────────────────────────────────────────────
  40.  {:cF3} {exec-N jabber} {}            JABBER Reader
  41.  
  42.  
  43. The next two utilities are used in various macros to wait for carrier detect
  44. to drop, then continue dialing (ncr) and to hangup when necessary and continue
  45. dialing (hng):
  46.  
  47.  {:ncr} {pause 1} {ifca ncr} {pause 5} {dial ,} {beep} {}
  48.  {:hng} {pause 1} {hangup y} {pause 3} {dial ,} {beep} {}
  49.  
  50.  
  51.  My generic login macro will login to most popular BBS's.  The generic login
  52.  subroutine can be called from mail run macros, etc.  The GOLOok with the
  53.  ";passwor" ignores the string "password" in the opening instructions on an
  54.  Auntie board.  Put {login} in your Dialing Directory macro field.
  55.  
  56.  Generic login macro
  57.  ───────────────────────────────────────────────────────────────────────────
  58.  {:login} {capture y,c:\commo\commo.cap}      RBBS, PCBoard, Auntie, etc.
  59.           {asci ,} {call gls} {}
  60.  
  61.  Generic login subroutine
  62.  ───────────────────────────────────────────────────────────────────────────
  63.   {:gls} {setlook 60,hng,10,|}
  64.   {:li1} {golo li2,(enter)}             {golo li3,graphics (enter)}
  65.          {golo li4,first name}          {golo li5,last name}
  66.          {golo li3,is this correct}     {golo li1,;passwor}
  67.          {lookfor password}             {send ~%_pas|} {return}
  68.   {:li2} {send ~|}        {goto li1}
  69.   {:li3} {send ~y|}       {goto li1}
  70.   {:li4} {send ~Fred|}    {goto li1}
  71.   {:li5} {send ~Brucker|} {goto li1}
  72.  
  73.  
  74. Here is a macro using variables to do a mail run on a PCBoard with a MarkMail
  75. door or a QMail door.  It will upload a reply packet if one exists, delete the
  76. packet if the upload is successful, then log off.  If there is no reply packet
  77. it will download new messages and log off. At the end it will wait for carrier
  78. detect to drop, then continue multi-number dialing.
  79.  
  80. The subroutines "mail_up" and "mail_dn" can be changed to use any protocol.
  81. The supplied ones use the Internal Xmodem-1k.
  82.  
  83. Four variables must be set prior to starting this macro.  These can be set in
  84. Dialing Directory entry or in the Linked Macro.  For example, to call Northern
  85. Lights and use the QMail door, the Dialing Directory (all on one line!) would
  86. be:
  87.  
  88.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {pcbmail} {} ...
  89.       ... {nodeid,nlbbs} {maildoor,qmail} {nomsgs,sorry, but no} {ptim,2}
  90.  
  91. This will set the variables and go direct to "pcbmail."
  92.  
  93. To use a Linked Macro instead you would have a Dialing Directory entry like:
  94.  
  95.   Northern Lights   12/21/91  {1 207 761 4782}  {password} {northern} {}
  96.  
  97. And then have a Linked Macro such as:
  98.  
  99.   {:northern}
  100.         {setv nodeid,nlbbs}             Set node id
  101.         {setv maildoor,qmail}           Set door type
  102.         {setv nomsgs,sorry, but no}     Set message to LOOKfor if no messages
  103.         {setv ptim,2}                   Set prompt timer duration
  104.         {goto pcbmail}                  GOTO the mail run macro
  105.  
  106.  
  107.  PCBoard generic mailrun
  108.  ───────────────────────────────────────────────────────────────────────────
  109.  {:pcbmail}
  110.          {capt y,c:\commo\%nodeid.%_day} {asci ,}
  111.          {setl 30,hng} {look ^g} {call gls}
  112.          {setl 60,hng,%ptim,n|} {look command?}
  113.          {setl 90,hng}  ** turn off prompt timer
  114.  
  115.          {send open %maildoor|} {look %maildoor command?}
  116.          {ifex %uldir\%nodeid.rep,,mr_dl}  ** if no reply, go to download
  117.  {:mr_ul}
  118.          {send u|} {look %nodeid.rep} {call mail_up}
  119.          {look command?} {ifcon mr_gb,mr_ul} ** if error, try again
  120.  {:mr_dl}
  121.          {send d|} {push}
  122.          {golo mr_gb,%nomsgs} {golo mr_sy,when done?}
  123.          {golo mr_sy,messages (y/n)?} {look %nodeid.qwk} {pops}
  124.          {call mail_dn} {look command?} {ifcon ,mr_dl} ** if error, try again
  125.  {:mr_gb}
  126.          {send g|} {goto ncr}
  127.  {:mr_sy}
  128.          {send y|} {return}
  129.  
  130.  {:mail_dn} {pause 2} {rxmo %dldir\%nodeid.qwk} {comp %_err,0} {return}
  131.  
  132.  {:mail_up} {sxmo-k %uldir\%nodeid.rep} {ifer 1,mu_end}
  133.             {exec-N del %uldir\%nodeid.rep}
  134.  {:mu_end}  {comp %_err,0} {return}
  135.  
  136.  
  137. This is my mail run macro for Directory Assistance using the JIMMER RBBS mail
  138. door.  If a reply packet exists, it will be uploaded.  If there is no reply
  139. packet it will download the new messages.
  140.  
  141.  Directory Assistance mail run
  142.  ───────────────────────────────────────────────────────────────────────────
  143.  {:damail}
  144.          {unmark 3dir 2dir} {setv nodeid,dirasnt}
  145.          {capt y,\commo\dir.%_day} {asci ,}
  146.          {setl 60,hng}
  147.          {golo ncr,no carrier}
  148.          {look =-=-=-=-=-}
  149.          {setl 60,hng,3,n|}
  150.          {look first name} {send fred;brucker;%_pass%;!main|}
  151.          {golo ncr,no carrier}
  152.          {look your command} {send open jimmer|}
  153.          {setl 60,hng}
  154.          {call dm3}
  155.          {ifex %uldir\%nodeid.rep,,dm1}
  156.  {:dm0}  {send u|} {look %nodeid.rep} {call mail_up}
  157.          {call dm3} {ifcon ,dm0} {send g|} {goto dm2}
  158.  {:dm1}  {send d|}
  159.          {golo hng,no messages to download}
  160.          {golo hng,you must select}
  161.          {setl 300,hng}
  162.          {look %nodeid.qwk} {call mail_dn} {call dm3} {ifcon ,dm1}
  163.  {:dm2}  {send g|} {look slam!} {goto hng}
  164.  
  165.  {:dm3}  {push}
  166.          {golo dm4,to continue>}
  167.          {golo dm5,no carrier}
  168.          {look your selection} {pops} {return}
  169.  {:dm4}  {send |} {return}
  170.  {:dm5}  {pops} {goto ncr}
  171.  
  172.  
  173.  Here's my latest whizbang quoting macro.  It saves the Screen Image File
  174.  pathname in the variable "scrsav."
  175.  
  176.  Then it sets the Screen Image File to a temporary file and goes into
  177.  Scrollback.  In Scrollback I write a block of text to disk (the quote), then
  178.  exit.  My editor (QEdit) is then executed on the temporary file.  I do what I
  179.  need there to dress up the quote (like add quoting marks, etc.).  When I save
  180.  the file and exit the editor, the macro does an ASCII Upload of the file and
  181.  deletes it.
  182.  
  183.  Then the Screen Image pathname is restored to what it was before.
  184.  
  185.  Quoting macro
  186.  ───────────────────────────────────────────────────────────────────────────
  187.  {:cf6} {setv scrsav,%_scr} {screen n,%dldir\temp} {scroll}
  188.         {exec-N q %_scr} {asci %_scr}
  189.         {exec-N del %_scr} {screen n,%scrsav} {}
  190.  
  191.